package com.whmskj.xjlhbc.mapper;

import com.whmskj.xjlhbc.dto.EnergyConsumption.MeterDetail;
import com.whmskj.xjlhbc.dto.EnergyConsumption.WorkShopEnergyDetailsDto;
import com.whmskj.xjlhbc.dto.EnergyConsumption.WorkShopEnergyDto;
import com.whmskj.xjlhbc.dto.EnergyConsumption.WorkShopEnergySummaryVo;
import lombok.Data;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: Sakura
 * @Date: 2025/8/21 10:36
 * @Version: v1.0.0
 * @Description: TODO
 **/
@Mapper
public interface EnergyConsumptionMapper {
    /**
     * 查询每日能耗
     * @param startDate
     * @param endDate
     * @param workshop
     * @return
     */
    List<WorkShopEnergyDto> selectDailyEnergyConsumption(@Param("startDate") Date startDate,
                                                         @Param("endDate") Date endDate,
                                                         @Param("workshop") String workshop);

    /**
     * 查询合计能耗和电费
     * @param startDate
     * @param endDate
     * @param workshop
     * @return
     */
    WorkShopEnergySummaryVo selectTotalEnergyConsumption(@Param("startDate") Date startDate,
                                                                    @Param("endDate") Date endDate,
                                                                    @Param("workshop") String workshop);

    /**
     * 查询启用的电费单价
     * @return
     */
    BigDecimal getActiveUnitPrice();



    /**
     * 查询车间电表能耗详情
     * @param workshop
     * @param unitPrice
     * @return
     */
    List<MeterDetail> selectEnergyDetailsByDate(@Param("workshop") String workshop,
                                                @Param("queryDate") Date queryDate,
                                                @Param("unitPrice") BigDecimal unitPrice);

}
